#ifndef UNRELIABLE_LAYER_H
#define UNRELIABLE_LAYER_H

#include "i_package_receiver.h"
#include <boost/asio.hpp>

class UnreliableLayerImp;

class UnreliableLayer : public IPackageReceiver
{
	boost::shared_ptr<UnreliableLayerImp> imp_;
	
public:
	virtual void handle(const udp::endpoint& remoteAddr, IPackage::Ptr package, IPackageSender::Ptr sender, unsigned int packageSeq);
	void config(double lostRate, unsigned int avgDelay, unsigned int delayDelta);
	UnreliableLayer(boost::shared_ptr<IPackageReceiver> packageHandler, boost::asio::io_service& service);
	virtual ~UnreliableLayer();
};

#endif